package com.wlyuan.open.scanner.application.handler.full;

import com.wlyuan.open.dto.OpenCombineSyncDTO;
import com.wlyuan.open.scanner.application.annotation.ScannerCode;
import com.wlyuan.open.scanner.assembler.ScannerCombineAssembler;
import com.wlyuan.open.scanner.constant.ScannerCodeEnum;
import com.wlyuan.open.scanner.domain.combine.Combine;
import com.wlyuan.open.scanner.repository.OrderCombineRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lijing
 * @description
 */
@ScannerCode(code = ScannerCodeEnum.COMBINE)
@Service
@Slf4j
@RequiredArgsConstructor
public class ScannerCombineHandler extends BaseScannerHandler<Combine, OpenCombineSyncDTO> {
    private final OrderCombineRepository orderCombineRepository;

    @Override
    protected List<Combine> select() {
        return orderCombineRepository.combineList();
    }

    @Override
    protected List<OpenCombineSyncDTO> assembler(List<Combine> data) {
        return ScannerCombineAssembler.assemble(data);
    }
}
